fix(agentrun): unwrap data envelopes#1920
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Nice fix — the |
|
Clean fix! Using |
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
Fixes AgentRun data-plane JSON parsing for data envelope responses. Clean minimal change. unwrapData may incorrectly strip legitimate data fields from non-envelope responses - consider structural guards.
| @@ -102,6 +102,13 @@ JsonNode getSandbox(String sandboxId) throws IOException { | |||
| return AgentRunRetry.withRetries(opt.getMaxRetries(), () -> getJson(url)); | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
[minor] unwrapData checks only hasNonNull(data) without distinguishing envelope from regular response. Add structural guards (check outer node lacks id/status fields before unwrapping).
AgentScope-Java Version
2.0.0-SNAPSHOT
Description
This PR fixes AgentRun data-plane JSON handling when successful responses are wrapped in a
dataenvelope.Background:
AgentRunDataPlaneHttppreviously parsed response JSON from the root node.data, so fields likeidandstatuswere not visible to the client code.Changes made:
unwrapData(...)inAgentRunDataPlaneHttpand applied it ingetJson()andpostJson().AgentRunDataPlaneHttpTestto mock wrapped responses and verify parsing still works.Related issues:
AgentRunDataPlaneHttp响应 JSONdata信封未解包 #1907How to test:
mvn -pl agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-agentrun -am -Dtest=AgentRunDataPlaneHttpTest test